Imports Sys = System

Namespace Enhancements.Core
    ''' <summary>The exception that is thrown when a value is in a range.</summary>
    <DebuggerStepThrough()> _
    Public NotInheritable Class IsInRangeException
        Inherits AssertException

        Friend Sub New(ByVal _objectName As System.String, ByVal _object As Sys.Int64, ByVal _objectMinimum As Sys.Int64, ByVal _objectMaximum As Sys.Int64)
            MyBase.New(_objectName)
            [Object] = _object
            ObjectMinimum = _objectMinimum
            ObjectMaximum = _objectMaximum
        End Sub

        Private __Object As Sys.Int64 = 0
        ''' <summary>Gets the value of the object that caused this exception.</summary>
        Public Property [Object]() As Sys.Int64
            Get
                Return __Object
            End Get
            Private Set(ByVal _value As Sys.Int64)
                __Object = _value
            End Set
        End Property

        Private __ObjectMinimum As Sys.Int64 = 0
        ''' <summary>Gets the minimum value allowed for the object.</summary>
        Public Property ObjectMinimum() As Sys.Int64
            Get
                Return __ObjectMinimum
            End Get
            Private Set(ByVal _value As Sys.Int64)
                __ObjectMinimum = _value
            End Set
        End Property

        Private __ObjectMaximum As Sys.Int64 = 0
        ''' <summary>Gets the maximum value allowed for the object.</summary>
        Public Property ObjectMaximum() As Sys.Int64
            Get
                Return __ObjectMaximum
            End Get
            Private Set(ByVal _value As Sys.Int64)
                __ObjectMaximum = _value
            End Set
        End Property

    End Class
End Namespace
